import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooOsPlatformController } from '../../../controllers';
const uctooosPlatformRouter = new Router();
const osPlatformController = new uctooOsPlatformController();

uctooosPlatformRouter.post('/add', requireUser, osPlatformController.add);
uctooosPlatformRouter.post('/edit', requireUser, rowLevelPermission('uctoo/os_platform'), osPlatformController.edit);
uctooosPlatformRouter.post('/del', requireUser, rowLevelPermission('uctoo/os_platform'), osPlatformController.delete);

//For getting osPlatform with permission control
uctooosPlatformRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/os_platform'), osPlatformController.getSingle);
uctooosPlatformRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/os_platform'), osPlatformController.getMany);
uctooosPlatformRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/os_platform'), osPlatformController.getMany);

//#endregion AutoCreateCode
export default uctooosPlatformRouter;
